﻿@model LeadVinaglue.Models.BaseModel

@if (!string.IsNullOrEmpty(Model.Keyword))
{
    <div class="search">
        <ul>
            <li class="first"><input type="text" class="text" id="keywords" name="keywords" placeholder="@Model.Keyword" value="@Model.Keyword" maxlength="100" autocomplete="off" /></li>
            <li>
                <select name="category" class="select" id="category">
                    <option value="0">---Tất cả---</option>
                    @foreach (var item in Model.CategoryList)
                    {
                        if (item.ID == Model.CategoryId)
                        {
                            <option value="@item.ID" selected="selected">@item.Name</option>                 
                        }
                        else
                        {
                            <option value="@item.ID">@item.Name</option>                    
                        }
                    }
                </select>
            </li>
            <li><input type="button" id="btnSearch" class="btn-search" value="Tìm" /></li>
        </ul>        
    </div>
}
else
{
    <div class="search">
        <ul>
            <li class="first"><input type="text" class="text" id="keywords" name="keywords" value="" placeholder="Nhập từ khóa" title="Nhập từ khóa" maxlength="100" autocomplete="off" /></li>
            <li>
                <select name="category" class="select" id="category">
                    <option value="0">---Tất cả---</option>
                    @foreach (var item in Model.CategoryList)
                    {
                        <option value="@item.ID">@item.Name</option>
                    }
                </select>
            </li>
            <li><input type="button" id="btnSearch" class="btn-search" value="Tìm" /></li>
        </ul>
    </div>
}